window.onload=function(){
		var log = $("#order").val();
			var log = document.getElementById("order");
		log.onclick=function(){
			//var tel 	  =$('#tel').val();
			var food_name = $('#food_name').val();
			var idea 	  =$('#idea').val();
	        var canteen	  =$('#cantten').val();
	        var img		  =$("#file").val();
	       // var food_time =$("#food_time").val();
	        console.log(img);
			if(!/^[0-9]{11}$/.test(tel)) alert("手机号输入不正确，请重新输入");
			if(/^[0-9]{11}$/.test(tel))
			{				
						var postData = {
							"submit":"确认发布",
							"tel": tel,
							"food_name":food_name,
							"canteen":canteen,
							"idea":idea,
							"img":img,
							"name":img,
							"food_time":food_time
						}
						console.log(postData);
						
						$.post('http://118.89.25.120/publish_share.php', postData, function (data) {
							var obj  = JSON.parse(data.trim());
							console.log(typeof obj);
							console.log(obj);	
							if(obj.success==1)  {
								window.location="prompt.html";
							} else if (obj.success==0) {
								alert("发布失败");
							} 
						});
			}

	}
}